package blatt6;

public class Interval implements Comparable<Interval>{
	private int start, end;
	
	public Interval(int start, int end){
		this.start = start;
		this.end = end;
	}
	public int getStart(){
		return start;
	}
	public int getEnd(){
		return end;
	}
	public String toString(){
		return "["+ start +","+ end +"]";
	}
	
	public int compareTo(Interval item) {
        if(end < item.getEnd())
            return -1;
        if(end > item.getEnd())
            return 1;
        return 0;
    }
}

